package com.ycz.sportplay.service.impl;

import com.ycz.sportplay.bean.User;
import com.ycz.sportplay.dao.UserDao;
import com.ycz.sportplay.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @ClassName UserServiceImpl
 * @Author yanchengzhi
 * @date 2022.06.15 00:03
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User getUserByMessage(String username, String password) {
        return userDao.getUserByMessage(username,password);
    }

    @Override
    public int getUserCounts(String query) {
        return userDao.getUserCount(query);
    }

    @Override
    public List<User> getUserList(String query, int pageStart, Integer pageSize) {
        return userDao.getAllUsers(query,pageStart,pageSize);
    }

    @Override
    public int updateState(Integer id, boolean state) {
        return userDao.updateState(id,state);
    }

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public int deleteUser(Integer id) {
        return userDao.deleteUser(id);
    }

    @Override
    public User getUserById(Integer id) {
        return userDao.getUserById(id);
    }

    @Override
    public int editUser(User user) {
        return userDao.editUser(user);
    }
}
